<?php
namespace Project\Model;

use Zend\InputFilter\Factory as InputFactory;     // <-- Add this import
use Zend\InputFilter\InputFilter;                 // <-- Add this import
use Zend\InputFilter\InputFilterAwareInterface;   // <-- Add this import
use Zend\InputFilter\InputFilterInterface;        // <-- Add this import

class Task implements InputFilterAwareInterface
{
	public $id;
	public $completeddatetime;
	public $completed;
	public $duedatetime;
	public $description;
	public $name;
	public $status;
	public $activity_id;
	public $requestedbyuser__user_id;
	public $project_id;

	protected $inputFilter;                       // <-- Add this variable

	public function exchangeArray($data)
	{
		$this->id     = (isset($data['id']))     ? $data['id']     : null;
		$this->completeddatetime = (isset($data['completeddatetime'])) ? $data['completeddatetime'] : null;
		$this->completed  = (isset($data['completed']))  ? $data['completed']  : null;
		$this->duedatetime = (isset($data['duedatetime'])) ? $data['duedatetime'] : null;
		$this->description = (isset($data['description'])) ? $data['description'] : null;
		$this->name = (isset($data['name'])) ? $data['name'] : null;
		$this->status = (isset($data['status'])) ? $data['status'] : null;
		$this->activity_id = (isset($data['activity_id'])) ? $data['activity_id'] : null;
		$this->requestedbyuser__user_id = (isset($data['requestedbyuser__user_id'])) ? $data['requestedbyuser__user_id'] : null;
		$this->project_id = (isset($data['project_id'])) ? $data['project_id'] : null;
		
	}

	// Add content to this method:
	public function setInputFilter(InputFilterInterface $inputFilter)
	{
		throw new \Exception("Not used");
	}

	public function getInputFilter()
	{
		if (!$this->inputFilter) {
			$inputFilter = new InputFilter();
			$factory     = new InputFactory();

			$inputFilter->add($factory->createInput(array(
					'name'     => 'id',
					'required' => true,
					'filters'  => array(
							array('name' => 'Int'),
					),
			)));

			$inputFilter->add($factory->createInput(array(
					'name'     => 'completeddatetime',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));

			$inputFilter->add($factory->createInput(array(
					'name'     => 'completed',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'duedatetime',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'description',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'name',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
			
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'status',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
			
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'activity_id',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
			
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'requestedbyuser__user_id',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
			
			)));
			$inputFilter->add($factory->createInput(array(
					'name'     => 'project_id',
					'required' => true,
					'filters'  => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
			
			)));

			$this->inputFilter = $inputFilter;
		}

		return $this->inputFilter;
	}
}